import Script from 'next/script'

export default function Index({ info }) {
  const schema = {
    "@context": "https://schema.org",
    "@type": "WebSite",
    "url": info?.website,
    "name": info?.name || "首页",
    "description": info?.description || "我们专注于提供优质内容和服务，帮助您获取所需信息。",
    "publisher": {
      "@type": "Organization",
      "name": info?.name || "首页",
      "logo": {
        "@type": "ImageObject",
        "url": `${info?.website}${info?.logo || '/default-logo.png'}`,
      }
    },
    "inLanguage": "zh-CN"
  }

  return (
    <Script id="ld-json-home" type="application/ld+json" strategy="afterInteractive" dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }} />
  )
}
